from rest_framework import serializers

from recruit.models import Enterprise, Recruit
from users.models import User


class EnterpriseSearchHotlistSerializer(serializers.ModelSerializer):
    class Meta:
        model = Enterprise
        fields = '__all__'


# 企业
class EnterpriseSerializer(serializers.ModelSerializer):
    class Meta:
        model = Recruit
        fields = '__all__'


# 职位
class RecruitsSerializer(serializers.ModelSerializer):

    enterprise = EnterpriseSerializer()

    class Meta:
        model = Recruit
        fields = '__all__'


# 企业
class EenterpriseIdSerializer(serializers.ModelSerializer):
    recruits = RecruitsSerializer(many=True)

    class Meta:
        model = Enterprise
        fields = '__all__'
